function step(motor)
  resetRotationCount(motor)
  forward(motor, speed)
  repeat until rotationCount(motor) > dist
  backward(motor, speed)
  repeat until rotationCount(motor) <= 0
  stop(motor)
end

speed = 80
dist = 45

repeat
  step(A)
  step(C)
until isPressed(ESCAPE)



